package com.scs.application.modules.msg.enums;

import lombok.Getter;

/**
 */
public enum MessageType {
    INNER("inner", "站内信"), WECHAT("wechat", "微信"),
    SMS("sms", "短信"), EMAIL("email", "邮件");

    @Getter
    private String code;

    @Getter
    private String desc;

    MessageType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MessageType of(String code){
        switch (code){
            case "inner":
                return MessageType.INNER;
            case "wechat":
                return MessageType.WECHAT;
            case "sms":
                return MessageType.SMS;
            case "email":
                return MessageType.EMAIL;
        }
        return MessageType.INNER;
    }
}
